﻿// Shader-Based-Image-Processing (SBIP)
// http://code.google.com/p/sbip/
//
// Copyright © Frank Nagl, 2009-2010
// admin@franknagl.de
//
namespace SBIP
{
    using System.Windows.Forms;
    using System;
    using SBIP.Filter;

    /// <summary>Filter specified properties form.</summary>
    public partial class RotateChannelsForm : Form
    {
        RotateChannels filter;

        /// <summary>
        /// Initializes a new instance of the <see cref="RotateChannelsForm"/> class.
        /// </summary>
        /// <param name="processor">The processor.</param>
        public RotateChannelsForm(Processor processor)
        {
            InitializeComponent();
            this.filter = new RotateChannels();
            processor.Filter = this.filter;
        }

        private void RGBRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (((RadioButton)sender).Checked)
                filter.Order = RGBOrder.RGB;
        }

        private void RBGRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (((RadioButton)sender).Checked)
                filter.Order = RGBOrder.RBG;
        }

        private void BRGRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (((RadioButton)sender).Checked)
                filter.Order = RGBOrder.BRG;
        }

        private void BGRRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (((RadioButton)sender).Checked)
                filter.Order = RGBOrder.BGR;
        }

        private void GBRRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (((RadioButton)sender).Checked)
                filter.Order = RGBOrder.GBR;
        }

        private void GRBRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (((RadioButton)sender).Checked)
                filter.Order = RGBOrder.GRB;
        }
    }
}
